<?php

header("Content-Type: application/json");
include('../../include/functions.inc.php');
$courses = null;
$sql = "select b.CODE,b.NAME,a.CYCLE from cllg_courses_pensum a inner join
            cllg_courses_catalog b on a.FK_COURSE=b.CODE";
$where = " where a.FK_PENSUM = " . sqlValue(getParam("CODE"), "int");
//echo $sql.$where;
$courses = $db->query_toJson_sql($sql . $where, array("CODIGO" => "CODE", "NOMBRE" => "NAME", "CICLO" => "CYCLE"));

echo $courses;
?>